home *** CD-ROM | disk | FTP | other *** search
- struct s_date
- {
- int month;
- int day;
- int year;
- };
-
- int function_requiring_pointer_to_date(struct s_date * p_date);
- int function_requiring_reference_to_date(struct s_date & date);
-
- void calling_function()
- {
- struct s_date my_date;
- function_requiring_pointer_to_date(&my_date);
- function_requiring_reference_to_date(my_date);
- ...
- };
-
- int function_requiring_pointer_to_date(struct s_date *p_date)
- {
- int month;
- month = p_date->month;
- ....
- }
-
- int function_requiring_reference_to_date(struct s_date & date)
- {
- int month;
- month = date.month;
- ...
- }
-
-